#ifndef _TIME_H_
#define _TIME_H_

/* Default includes */
#include <ctime>
/**/

//! Time measuring for testing the program.
/*!
	Increses readability to time functions.
*/
namespace TimeMeasure {
	using namespace std;

	/*! variable for storing the time value */
	extern time_t start_time;
	
	/*!
		function for using before the desired code.
		\return the time passed
		\sa time_t Check()
		\sa time_t End()
		\code
		Start();
		function();					// the function to be evaluated
		cout << End() << endl;	// tells how much time has passed since the Start() in milisseconds
		\endcode
	*/
	inline time_t Start(){
		return start_time = time( NULL );
	};

	/*!
		function for using somwhere in the desired code.
		\return the time passed
		\sa time_t Start()
		\sa time_t End()
		\code
		Start();
		function1();					// a function to be evaluated
		cout << Check() << endl;	// tells how much time has passed since the Start() in milisseconds
		function2();					// another function to be evaluated
		cout << End() << endl;		// tells how much time has passed since the Start() in milisseconds
		\endcode
	*/
	inline time_t Check(){
		return time( NULL ) - start_time;
	};

	/*!
		function for using before the desired code.
		\sa time_t Start()
		\sa time_t Check()
		\code
		Start();
		function();					// the function to be evaluated
		cout << End() << endl;	// tells how much time has passed since the Start() in milisseconds
		\endcode
	*/
	inline time_t End(){
		return time( NULL ) - start_time;
	};

};

#endif // _TIME_H_
